<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateOpenShopUserExtContract extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('open_shop_user_ext_contract', function (Blueprint $table) {
            $table->id();

            $table->unsignedInteger('contractId')->default(0)->comment('夸父平台合同id');
            $table->string('contractExtNo', 60)->default('')->comment("第三方合同编号");
            $table->string('contractName', 120)->default('')->comment("合同名称");
            $table->string('contractUrl', 255)->default('')->comment("合同url");
            $table->string('downloadUrl', 255)->default('')->comment("合同下载url");

            $table->tinyInteger('signStatus')->default(0)->comment("签约状态  0 ： 待签约 1 ： 已签约");
            $table->unsignedInteger('signTime')->default(0)->comment('签约时间');

            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');

            $table->collation = 'utf8mb4_general_ci';
            $table->index(['contractId'], 'idx_contractId');
            $table->index(['contractExtNo'], 'idx_contractExtNo');
            $table->comment = '招商加盟 - 第三方合同信息表';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('open_shop_user_ext_contract');
    }
}
